<template>
	<view class="assets-info">
		<view class="padding text-center">
			<view class="padding-xl radius shadow-blur bg-red margin-top bg-img" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big91005.jpg);">
				<view>个人经济查询</view>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="title">当前金币持有量</view>
			<input disabled v-model="economy.balance" placeholder="当前金币持有量" name="input"></input>
		</view>
		<view class="cu-form-group">
			<view class="title">当前节操币余额</view>
			<input disabled v-model="baseInfo.money" placeholder="当前节操币余额" name="input"></input>
		</view>
		<view class="cu-form-group">
			<view class="title">历史充值节操币</view>
			<input disabled v-model="baseInfo.allcharge" placeholder="历史充值节操币" name="input"></input>
		</view>
		<view class="cu-form-group">
			<view class="title">历史消费节操币</view>
			<input disabled v-model="baseInfo.allpay" placeholder="历史消费节操币" name="input"></input>
		</view>
	</view>
</template>

<script>
	import ajax from '../../../Ajax/index.js'
	import common from '../../../common/index.js'
	export default {
		data() {
			return {
				baseInfo: {},
				economy: {},
				playerName: ''
			}
		},
		mounted() {
			let playerName = common.getCookie('playerName')
			if (!!!playerName) {
				uni.showToast({title: '请登录', icon: 'none'})
				return
			}
			this.playerName = playerName
			this.getMcrmbPlayerInfo()
			this.getPlayerEconInfo()
		},
		methods: {
			getMcrmbPlayerInfo() {
				let param = new URLSearchParams()
				param.append("playerName", this.playerName)
				ajax.post('mcrmb/getPlayerMcRmbInfo', param).then(res => {
					if (res.data.code == 101) {
						this.baseInfo = res.data.data[0]
					}
				})
			},
			getPlayerEconInfo() {
				let param = new URLSearchParams()
				param.append("playerName", this.playerName)
				ajax.post('economy/getPlayerEconomy', param).then(res => {
					if (res.data.code == 200) {
						this.economy = res.data.res
					}
				})
			},
		}
	}
</script>

<style>

</style>
